<?php

$api = app('Dingo\Api\Routing\Router');

$api->version('V1',[
    'namespace'=>'App\Http\Controllers\Api\V1\Frontend\Auth'
],function ($api){
    $api->group([
        'prefix' => 'frontend'
    ],function ($api){
        $api->group([
            'prefix'=>'auth'
        ],function ($api){
           $api->get('test','IndexController@demo');
        });






















        $api->group([
            'prefix'=>'auth'
        ],function ($api){
            //account检测
            $api->get('account/check','IndexController@accountCheck')
                ->name('frontend.auth.account.check.get');








            //用户注册
            $api->post('register','IndexController@register')
                ->name('frontend.auth.register.post');

            //用户登录
            $api->post('login','IndexController@commonLogin')
                ->name('frontend.auth.login.post');

            //快速登录
            $api->post('fast','IndexController@fastLogin')
                ->name('frontend.auth.fast.post');

            //社会化登录
            $api->post('socialite','IndexController@socialiteLogin')
                ->name('frontend.auth.socialite.post');

            //安全退出
            $api->put('logout','IndexController@logout')
                ->middleware('jwt.token')
                ->name('frontend.auth.logout.put');

            //用户注册
            $api->post('register','IndexController@register')
                ->name('frontend.auth.register.post');
        });
    });
});
